package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCgCpDimMapper;
import com.ruoyi.system.domain.SysCgCpDim;
import com.ruoyi.system.service.ISysCgCpDimService;

/**
 * SysCgCpDimService业务层处理
 * 
 * @author SYF
 * @date 2025-04-30
 */
@Service
public class SysCgCpDimServiceImpl implements ISysCgCpDimService 
{
    @Autowired
    private SysCgCpDimMapper sysCgCpDimMapper;

    /**
     * 查询SysCgCpDim
     * 
     * @param yongyouCode SysCgCpDim主键
     * @return SysCgCpDim
     */
    @Override
    public SysCgCpDim selectSysCgCpDimByYongyouCode(String yongyouCode)
    {
        return sysCgCpDimMapper.selectSysCgCpDimByYongyouCode(yongyouCode);
    }

    /**
     * 查询SysCgCpDim列表
     * 
     * @param sysCgCpDim SysCgCpDim
     * @return SysCgCpDim
     */
    @Override
    @DataSource(DataSourceType.SLAVEDM)
    public List<SysCgCpDim> selectSysCgCpDimList(SysCgCpDim sysCgCpDim)
    {
        return sysCgCpDimMapper.selectSysCgCpDimList(sysCgCpDim);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDM)
    public List<SysCgCpDim> selectCpDimByYongyouCode(String yongyouCode){
        return sysCgCpDimMapper.selectCpDimByYongyouCode(yongyouCode);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDM)
    public List<SysCgCpDim> selectCpDimByYongyouName(String yongyouName){
        return sysCgCpDimMapper.selectCpDimByYongyouName(yongyouName);
    }

    /**
     * 新增SysCgCpDim
     * 
     * @param sysCgCpDim SysCgCpDim
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVEDM)
    public int insertSysCgCpDim(SysCgCpDim sysCgCpDim)
    {
        return sysCgCpDimMapper.insertSysCgCpDim(sysCgCpDim);
    }

    /**
     * 修改SysCgCpDim
     * 
     * @param sysCgCpDim SysCgCpDim
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVEDM)
    public int updateSysCgCpDim(SysCgCpDim sysCgCpDim)
    {
        return sysCgCpDimMapper.updateSysCgCpDim(sysCgCpDim);
    }

    /**
     * 批量删除SysCgCpDim
     * 
     * @param yongyouCodes 需要删除的SysCgCpDim主键
     * @return 结果
     */
    @Override
    public int deleteSysCgCpDimByYongyouCodes(String[] yongyouCodes)
    {
        return sysCgCpDimMapper.deleteSysCgCpDimByYongyouCodes(yongyouCodes);
    }

    /**
     * 删除SysCgCpDim信息
     * 
     * @param yongyouCode SysCgCpDim主键
     * @return 结果
     */
    @Override
    public int deleteSysCgCpDimByYongyouCode(String yongyouCode)
    {
        return sysCgCpDimMapper.deleteSysCgCpDimByYongyouCode(yongyouCode);
    }
}
